/*  ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** 
*   Copyright 2014 Jan-Marwin Wollschläger                                   *
*                                                                            *
*   Licensed under the Apache License, Version 2.0 (the "License");          *
*   you may not use this file except in compliance with the License.         *
*   You may obtain a copy of the License at                                  *
*                                                                            *
*       http://www.apache.org/licenses/LICENSE-2.0                           *
*                                                                            *
*   Unless required by applicable law or agreed to in writing, software      *
*   distributed under the License is distributed on an "AS IS" BASIS,        *
*   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
*   See the License for the specific language governing permissions and      *
*   limitations under the License.                                           *
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **   */   

/**
 * MolecularEditor - A Molecular Editor written in processing/processing.js. 
 *
 * @author Jan-Marwin Wollschläger
 * @version 0.1
 **/


boolean runUnitTests = true;

IMVC modelViewController;


public void addTestCases()
{
   ITestCase testAtom = new AtomTestCase();  // Instantiation of test case is enough 
   ITestCase testUnit = new UnitTestCase();  // to register it for unit testing
   ITestCase testBond = new BondTestCase();
   ITestCase testMolecule = new MoleculeTestCase();
   ITestCase testMoleculeCanvas = new MoleculeCanvasTestCase();
   ITestCase testVector2        = new Vector2TestCase();
   ITestCase testLine           = new LineTestCase();
}

public void setup()
{
 
   if(runUnitTests)
   {
       addTestCases();
       Unit.runAllUnitTests();
   }
   
   modelViewController = new DefaultMVC(this);
   
   size(modelViewController.getView().getSize().first,
        modelViewController.getView().getSize().second);
        
   background(255); 
   
}


public void mouseClicked()
{
    modelViewController.getController().mouseClicked();
}

public void keyPressed()
{
    modelViewController.getController().keyPressed();
}


public void draw()
{
   modelViewController.getView().updateView(this, modelViewController.getModel());  
}



